﻿
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;

/// <summary>
/// 长按按钮脚本 提供两个事件给外部 让外部去处理对应的逻辑
/// </summary>
public class LongPress : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
    public event UnityAction upEvene;
    public event UnityAction downEvene;
    public void OnPointerUp(PointerEventData eventData)
    {
        upEvene?.Invoke();
    }
    public void OnPointerDown(PointerEventData eventData)
    {
        downEvene?.Invoke();
    }
}
